/*  1:   */ package com.rinsi.app.zhcx.qycx.jtgs;
/*  2:   */ 
/*  3:   */ import com.rinsi.core.service.CoreSimpleService;
/*  4:   */ import com.rinsi.util.AssertUtil;
/*  5:   */ import com.rinsi.util.MapUtil;
/*  6:   */ import java.util.List;
/*  7:   */ import java.util.Map;
/*  8:   */ import org.mybatis.spring.SqlSessionTemplate;
/*  9:   */ import org.springframework.stereotype.Service;
/* 10:   */ 
/* 11:   */ @Service
/* 12:   */ public class ZhcxQycxJtgsService
/* 13:   */   extends CoreSimpleService
/* 14:   */ {
/* 15:   */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/* 16:   */   {
/* 17:19 */     rMap.putAll(getParams(model));
/* 18:   */   }
/* 19:   */   
/* 20:   */   public List<Map<String, Object>> downloadEx(Map<String, Object> model)
/* 21:   */   {
/* 22:25 */     Map<String, Object> params = getParams(model);
/* 23:   */     
/* 24:27 */     Map<String, Object> config = getConfig(model);
/* 25:   */     
/* 26:29 */     Map<String, Object> rMap = getRMap();
/* 27:   */     
/* 28:31 */     List<Map<String, Object>> datas = null;
/* 29:   */     try
/* 30:   */     {
/* 31:35 */       beforeList(model);
/* 32:   */       
/* 33:37 */       Integer page = MapUtil.getInteger(params, "page");
/* 34:   */       
/* 35:39 */       Integer rows = MapUtil.getInteger(params, "rows");
/* 36:   */       
/* 37:41 */       datas = getSqlSessionTemplate().selectList(namespace(config) + ".list", params);
/* 38:43 */       if ((MapUtil.getInteger(config, "module.page") != null) && (MapUtil.getInteger(config, "module.page").intValue() == 1)) {
/* 39:45 */         if (AssertUtil.isCollectionNotEmpty(datas))
/* 40:   */         {
/* 41:47 */           rMap.put("total", Integer.valueOf(datas.size()));
/* 42:   */           
/* 43:49 */           Integer begin = Integer.valueOf((page.intValue() - 1) * rows.intValue());
/* 44:   */           
/* 45:51 */           Integer end = Integer.valueOf(page.intValue() * rows.intValue());
/* 46:53 */           if (end.intValue() > datas.size()) {
/* 47:55 */             end = Integer.valueOf(datas.size());
/* 48:   */           }
/* 49:58 */           datas = datas.subList(begin.intValue(), end.intValue());
/* 50:   */         }
/* 51:   */         else
/* 52:   */         {
/* 53:62 */           rMap.put("total", Integer.valueOf(0));
/* 54:   */         }
/* 55:   */       }
/* 56:66 */       rMap.put("datas", datas);
/* 57:   */     }
/* 58:   */     catch (Exception ex)
/* 59:   */     {
/* 60:70 */       rMap.put("success", Boolean.valueOf(false));
/* 61:72 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/* 62:74 */         rMap.put("message", ex.getMessage());
/* 63:   */       } else {
/* 64:78 */         rMap.put("message", "展示数据列表出错！请稍后重试，或联系系统管理员！");
/* 65:   */       }
/* 66:81 */       rMap.put("ex", ex.getMessage());
/* 67:   */       
/* 68:83 */       ex.printStackTrace();
/* 69:   */     }
/* 70:86 */     afterList(model, rMap);
/* 71:   */     
/* 72:88 */     return datas;
/* 73:   */   }
/* 74:   */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.zhcx.qycx.jtgs.ZhcxQycxJtgsService
 * JD-Core Version:    0.7.0.1
 */